﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinqtoCRM.Tests.CRM;
using System.IO;

namespace LinqtoCRM.Tests
{
    public class CrmDataContext
    {
        public Query<contact> Contacts { get { return _contacts; } }
        public Query<account> Accounts{ get { return _accounts; } }

        private CrmQueryProvider _provider;
        private Query<contact> _contacts;
        private Query<account> _accounts;
        private Query<customerrelationship> _relations;
        public CrmDataContext(ICrmService service)
        {
            _provider = new CrmQueryProvider(service);
            _contacts = new Query<contact>(_provider);
            _accounts = new Query<account>(_provider);
            _relations = new Query<customerrelationship>(_provider);
        }

        public TextWriter Log
        {
            get { return _provider.Log; }
            set { _provider.Log = value; }
        }
    }
}
